#include <stdio.h>
#include <Python.h>

PyObject* pyf_SayHello(PyObject* self, PyObject* args)
{
  char* szText = NULL;
  if (! PyArg_ParseTuple(args, "s", &szText))
    return NULL;
  
  printf(szText);
  printf("\n");
  Py_IncRef(Py_None);
  return Py_None;  
}

static PyMethodDef DemoAppMethods[] = {
	{"SayHello",		       pyf_SayHello,			METH_VARARGS, ""},
	{NULL, NULL, 0, NULL}       
};

int main(int argc, const char *argv[])
{
  Py_Initialize();
  Py_InitModule("DemoApp", DemoAppMethods);
  printf("HelloWorld!\n");
  Py_Finalize();
  return 0;
}
